{include file="header.tpl"}
		<div id="page">
			<div id="header">
				<a href="#menu"></a>
				{$title} - CountSheep
			</div>
			<div id="content">
			   <div id="articlebox">
			        <p><a href="#" id="goback" style="text-decoration:none;font-weight:bold;color:#1d953f;font-size:12px;"><< 返回</a></p>
			        <form id="form1">
					<b>常用邮箱：</b>
					<div>
					    <input type="text" name="email" id="email" style="width:100%;"/>
					</div>
					<b>留言内容：</b>
					<div>
					    <textarea style="resize:none;width:100%;" rows=20 name="matter" id="matter"></textarea>
					</div>
					<div>
					    <input type="submit" name="submit" value="提交" style="width:100%;height:40px;background:#1d953f;border:0;color:#fff;font-weight:bold;line-height:40px" />
					</div>
					</form>
                </div>				
			</div>
			<nav id="menu">
				<ul>
					<li><a href="index.php">首页</a></li>
					<li><a href="web.php?cid=1">HTML / HTML5</a></li>
					<li><a href="web.php?cid=2">CSS （层叠样式表）</a></li>
					<li><a href="web.php?cid=3">JavaScript / jQuery</a></li>
					<li><a href="web.php?cid=4">随笔</a></li>
					<li><a href="web.php?cid=5">转载</a></li>
					<li><a href="web.php?cid=6">笑话集</a></li>
					<li><a href="message.php">留言板</a></li>
					<li><a href="about.php">关于博主</a></li>
				</ul>
			</nav>
		</div>
<script type="text/javascript">
			$(function() {
				$('nav#menu').mmenu();

				$('#goback').bind('click',function(){
				        window.location.href = 'index.php';
				});
				$('input[type=submit]').bind('click',function(){
                         if(!(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test($('#email').val()))){
                               alert('请输入正确格式的邮箱！');
						 }else if($('#matter').val().length < 5 ){
						       alert('留言内容不得少于5个字符！');
						 }else{
						       $('#form1').attr('method','post');
						       $.post('./message.php',$('#form1').serialize(),function(data){
                                         if(data){
										       window.location.reload();
										       alert('留言成功');
										 }else{
										       alert('留言失败');
										 }
							   });
						 };
						 return false;
				});
			});
</script>
{include file="footer.tpl"}
